﻿using System.Collections.ObjectModel;
using Prism.AvalonDock.Extensions;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation.Regions;
using Prism.ReoGrid.Mvvm;
using Prism.ReoGrid.Mvvm.Interfaces;
using unvell.ReoGrid;
using MahApps.Metro.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BomComparisonModule.ViewModels.ResultDialog
{
    public class BOM1ViewModel : BindableBase
    {

        private ReoGridControl _ReoGrid = new();

        private int _pageViews;
        //IRegionManager _regionManager;




        public int PageViews
        {
            get { return _pageViews; }
            set { SetProperty(ref _pageViews, value); }
        }


        //AvalonDock 设置
        public DockStrategy DockStrategy { get; set; }

        private string _bomfilename;


        public string BOMFilename
        {
            get { return _bomfilename; }
            set { SetProperty(ref _bomfilename, value); }
        }




        public BOM1ViewModel(IRegionManager regionManager)
        {
            //_regionManager = regionManager;
            BOMFilename = "BOM1";
            DockStrategy = new SideDockStrategy(DockSide.Left);


            // _ReoGrid.Load(@"F:\02_soft_project\ZHJ_ejTheta\Document\sourceTable.xlsx");


            InitCommands();

        }


        #region [Fields]
        private string _title = "BOMEntry File 1";

        private ObservableCollection<IRecordModel> _Books;
        private WorksheetModel _WorksheetModel;
        #endregion

        #region [Properties]

        public string Title
        {
            get { return _title; }
            set { SetProperty(ref _title, value); }
        }

        public DelegateCommand<ReoGridControl> LoadedCommand { get; set; }
        public DelegateCommand AddRecordCommand { get; set; }
        public DelegateCommand DeleteRecordCommand { get; set; }
        public DelegateCommand MoveRecordCommand { get; set; }
        public DelegateCommand EditRecordCommand { get; set; }
        public DelegateCommand GetFromUiCommand { get; set; }

        #endregion






        private void InitCommands()
        {
            LoadedCommand = new DelegateCommand<ReoGridControl>(OnLoadedCommand);
            AddRecordCommand = new DelegateCommand(OnAddRecordCommand);
            DeleteRecordCommand = new DelegateCommand(OnDeleteRecordCommand);
            MoveRecordCommand = new DelegateCommand(OnMoveRecordCommand);
            EditRecordCommand = new DelegateCommand(OnEditRecordCommand);
            GetFromUiCommand = new DelegateCommand(OnGetFromUiCommand);
        }

        private void OnLoadedCommand(ReoGridControl reoGridControl)
        {

        }



        private void OnAddRecordCommand()
        {

        }

        private void OnDeleteRecordCommand()
        {

        }

        private void OnMoveRecordCommand()
        {

        }

        private void OnEditRecordCommand()
        {

        }

        private void OnGetFromUiCommand()
        {

        }




        //public override void OnNavigatedTo(NavigationContext navigationContext)
        //{
        //    base.OnNavigatedTo(navigationContext);
        //    PageViews++;
        //}

    }
}
